package com.example.demo;

public class Test {
    public static void main(String[] args) {
        Haha<Integer> integerHaha = new Haha<>();
        integerHaha.setX(300);
        integerHaha.setY(200);
        System.out.println("integerHaha = " + integerHaha);
        Haha<String> stringHaha = new Haha<>();
        stringHaha.setY("东经30°");
        stringHaha.setX("北纬180°");
        System.out.println("stringHaha = " + stringHaha);
        Haha<Double> doubleHaha = new Haha<>();
        doubleHaha.setX(200.15);
        doubleHaha.setY(218.1);
        System.out.println("doubleHaha = " + doubleHaha);
    }

}
class Haha<T>{
    private T X;
    private T Y;

    public Haha() {
    }

    public Haha(T x, T y) {
        X = x;
        Y = y;
    }

    public T getX() {
        return X;
    }

    public T getY() {
        return Y;
    }

    public void setY(T y) {
        Y = y;
    }

    public void setX(T x) {
        X = x;
    }

    @Override
    public String toString() {
        return "Haha{" +
                "X=" + X +
                ", Y=" + Y +
                '}';
    }
}
